<div class="sites view">
<h2><?php  __('Site');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $site['Site']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Nome'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $site['Site']['nome']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Usuario'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($site['Usuario']['id'], array('controller' => 'usuarios', 'action' => 'view', $site['Usuario']['id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Edit Site', true), array('action' => 'edit', $site['Site']['id'])); ?> </li>
		<li><?php echo $html->link(__('Delete Site', true), array('action' => 'delete', $site['Site']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $site['Site']['id'])); ?> </li>
		<li><?php echo $html->link(__('List Sites', true), array('action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Site', true), array('action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Usuarios', true), array('controller' => 'usuarios', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Usuario', true), array('controller' => 'usuarios', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Estabelecimentos', true), array('controller' => 'estabelecimentos', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Estabelecimento', true), array('controller' => 'estabelecimentos', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Related Estabelecimentos');?></h3>
	<?php if (!empty($site['Estabelecimento'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Razao Social'); ?></th>
		<th><?php __('Cnpj'); ?></th>
		<th><?php __('Endereco'); ?></th>
		<th><?php __('Complemento'); ?></th>
		<th><?php __('Cep'); ?></th>
		<th><?php __('Estado'); ?></th>
		<th><?php __('Cidade'); ?></th>
		<th><?php __('Bairro'); ?></th>
		<th><?php __('Pais'); ?></th>
		<th><?php __('Telefone1'); ?></th>
		<th><?php __('Telefone2'); ?></th>
		<th><?php __('Telefone3'); ?></th>
		<th><?php __('Site Id'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($site['Estabelecimento'] as $estabelecimento):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $estabelecimento['id'];?></td>
			<td><?php echo $estabelecimento['razao_social'];?></td>
			<td><?php echo $estabelecimento['cnpj'];?></td>
			<td><?php echo $estabelecimento['endereco'];?></td>
			<td><?php echo $estabelecimento['complemento'];?></td>
			<td><?php echo $estabelecimento['cep'];?></td>
			<td><?php echo $estabelecimento['estado'];?></td>
			<td><?php echo $estabelecimento['cidade'];?></td>
			<td><?php echo $estabelecimento['bairro'];?></td>
			<td><?php echo $estabelecimento['pais'];?></td>
			<td><?php echo $estabelecimento['telefone1'];?></td>
			<td><?php echo $estabelecimento['telefone2'];?></td>
			<td><?php echo $estabelecimento['telefone3'];?></td>
			<td><?php echo $estabelecimento['site_id'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller' => 'estabelecimentos', 'action' => 'view', $estabelecimento['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller' => 'estabelecimentos', 'action' => 'edit', $estabelecimento['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller' => 'estabelecimentos', 'action' => 'delete', $estabelecimento['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $estabelecimento['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Estabelecimento', true), array('controller' => 'estabelecimentos', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
